import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useContentStore = defineStore('content', () => {
  const list = localStorage.getItem('user')
  const username = list ? ref<string>(JSON.parse(list).username) : ref<string>()
  const token = list ? ref<string>(JSON.parse(list).token) : ref<string>()
  const phone = list ? ref<string>(JSON.parse(list).phone) : ref<string>()
  const img = list ? ref<string>(JSON.parse(list).img) : ref<string>()
  return { username, token, phone, img }
})
